Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load reviewer for comments when dismissing a review #24281

Merged
merged 5 commits into from
Apr 23, 2023
Merged

Load reviewer for comments when dismissing a review #24281

merged 5 commits into from
Apr 23, 2023

Conversation

wolfogre
Copy link
Member

If a comment dismisses a review, we need to load the reviewer to show whose review has been dismissed.

Related to:

{{if eq .Review.OriginalAuthor ""}}
{{$reviewerName = .Review.Reviewer.Name}}
{{else}}
{{$reviewerName = .Review.OriginalAuthor}}
{{end}}
{{$.locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}}

Steps to reproduce the bug:
  1. Open a PR.
  2. Submit a review to the PR.
  3. Dismiss the review.
image 4. Then image

We doesn't need .Review.Reviewer for all comments, because "dismissing" doesn't happen often, or we would have already received error reports.

@wolfogre wolfogre added type/bug outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels Apr 23, 2023
@wolfogre wolfogre added this to the 1.20.0 milestone Apr 23, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 23, 2023
@pull-request-size pull-request-size bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 23, 2023
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 23, 2023
@wolfogre wolfogre changed the title Load reviewer comments when dismissing a review Load reviewer for comments when dismissing a review Apr 23, 2023
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 23, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 23, 2023
@delvh delvh added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 23, 2023
@techknowlogick techknowlogick enabled auto-merge (squash) April 23, 2023 14:26
@techknowlogick
Copy link
Member

🤖 🎺

@techknowlogick techknowlogick merged commit 066af37 into go-gitea:main Apr 23, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 23, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Apr 23, 2023
If a comment dismisses a review, we need to load the reviewer to show
whose review has been dismissed.

Related to:

https://github.com/go-gitea/gitea/blob/20b6ae0e5399cfc22c6a0989d8e520194e920bdd/templates/repo/issue/view_content/comments.tmpl#L765-L770

We don't need `.Review.Reviewer` for all comments, because
"dismissing" doesn't happen often, or we would have already received
error reports.
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Apr 23, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 24, 2023
* giteaofficial/main: (37 commits)
  [skip ci] Updated translations via Crowdin
  Add all `no-query` rules to eslint config (go-gitea#24294)
  Fix bug when deleting wiki with no code write permission (go-gitea#24274)
  Move code from module to service (go-gitea#24287)
  Add comments for Manually Merged feature (go-gitea#24291)
  Allow using localized absolute date times within phrases with place holders and localize issue due date events (go-gitea#24275)
  Handle canceled workflow as a warning instead of a fail (go-gitea#24282)
  Tweak pull request branch delete ui (go-gitea#23951)
  Restore air delay of 1000ms (go-gitea#24290)
  Load reviewer for comments when dismissing a review (go-gitea#24281)
  Set type="password" on all auth_token fields (go-gitea#22175)
  Only delete secrets belonging to its owner (go-gitea#24284)
  Fix inconsistent wiki path converting. (go-gitea#24277)
  Change to vertical navbar layout for secondary navbar for repo/user/admin settings  (go-gitea#24246)
  Refactor delete_modal_actions template and use it for project column related actions (go-gitea#24097)
  update upgrade script to use new CDN (go-gitea#24280)
  show workflow config error on file view also (go-gitea#24267)
  Add missing badges in user profile for /projects and /packages (go-gitea#24232)
  [skip ci] Updated translations via Crowdin
  Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (go-gitea#24270)
  ...

# Conflicts:
#	templates/base/footer_content.tmpl
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants